package com.hongyi.controller;
/**
 * @Author: hongyi
 * @CreateTime: 2024-10-21
 */


import com.hongyi.pojo.PostRequest;
import com.hongyi.result.Result;
import com.hongyi.service.Impl.ApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class ApiController {

    @Autowired
    private ApiService apiService;

    @PostMapping("/createPost")
    public Result createPost(@RequestBody PostRequest postRequest) {
        apiService.createPost(postRequest);
        return Result.success();
    }

}
